class clusters::ccopt{

  sudo::conf { 'suzz':
    priority => 15,
    source => "puppet:///modules/${module_name}/suzz",
  }

  cron{'checkafsprivate':
    command => "/bin/python3 /afs/ihep.ac.cn/soft/common/sysgroup/afs_crontab.py >> /var/log/checkafsprivate.log",
    user    => 'root',
    minute  => '00',
    hour    => '07',
  }

  cron{'lustre user usage':
    command => "/workfs2/cc/storman/statistic_lustre/user_usage.sh",
    user    => 'root',
    minute  => '00',
    hour    => '16',
    weekday => '4',
  }

  cron{'modify lustre project quota':
    command => "/workfs2/cc/storman/statistic_lustre/mod_pidquota.sh",
    user    => 'root',
    minute  => '30',
    hour    => '2',
    weekday => '3',
  } 

  cron{'lfscheck':
    command => "/afs/ihep.ac.cn/soft/common/sysgroup/lfscheck",
    user    => 'root',
    minute  => '00',
    hour    => '07',
  }

  cron{'matomatcheck':
    command => "/afs/ihep.ac.cn/soft/common/sysgroup/mat-monitor/matmon.sh",
    user    => 'root',
    minute  => '00',
    hour    => '09',
  }

  cron{'ybjinodecheck':
    command => "/afs/ihep.ac.cn/soft/common/sysgroup/ybjgfscheck/ybjinodecheck",
    user    => 'root',
    minute  => '0',
    hour    => '0',
    monthday  => '*/2',
  }
  cron{'ybjusercheck':
    command => "/afs/ihep.ac.cn/soft/common/sysgroup/ybjgfscheck/ybjusercheck",
    user    => 'root',
    minute  => '0',
    hour    => '0',
    monthday  => '*/3',
  }
  cron{'ybjgfscheck':
    command => "/afs/ihep.ac.cn/soft/common/sysgroup/ybjgfscheck/ybjgfscheck",
    user    => 'root',
    minute  => '0',
    hour    => '0',
    monthday  => '*/4',
  }
  cron{'tarlog':
    command => "/afs/ihep.ac.cn/soft/common/sysgroup/tarlog.sh",
    user    => 'root',
    minute  => '0',
    hour    => '21',
    weekday => '6',
  }

  cron{'statistic_afs':
    command => "/cvmfs/common.ihep.ac.cn/software/monitor_plugin/user_usage_plugin/getafsusage.sh",
    user    => 'root',
    minute  => '00',
    hour    => '08',
  }

  cron{'statistic_lustre':
    command => "/afs/ihep.ac.cn/soft/common/sysgroup/statistic_lustre/statistic_lustre",
    user    => 'root',
    minute  => '00',
    hour    => '06',
  }

  cron{'statisticseveryost':
    command => "/afs/ihep.ac.cn/soft/common/sysgroup/statistic_lustre/statisticseveryost.sh",
    user    => 'root',
    minute  => '*/1',
  }

  cron{'dfspacetotal':
    command => "/afs/ihep.ac.cn/soft/common/sysgroup/statistic_lustre/dfspacetotal.sh",
    user    => 'root',
    minute  => '*/1',
  }

  cron{'dfinodetotal':
    command => "/afs/ihep.ac.cn/soft/common/sysgroup/statistic_lustre/dfinodetotal.sh",
    user    => 'root',
    minute  => '*/1',
  }

  cron{'dfspace_pool':
   command => "/afs/ihep.ac.cn/soft/common/sysgroup/statistic_lustre/dfspace_pool.sh",
   user    => 'root',
   minute  => '30',
   hour    => '06',
 }

  cron{'check_quota':
   command => "/afs/ihep.ac.cn/soft/common/sysgroup/statistic_lustre/quotamail.sh",
   user    => 'root',
   minute  => '00',
   hour    => '08',
 }

  cron{'check_besfs5_groups_usage':
   command => "/afs/ihep.ac.cn/soft/common/sysgroup/statistic_lustre/besfs5_groups_check",
   user    => 'root',
   minute  => '00',
   hour    => '07',
   weekday => '3',
 }

  cron{'chkconfig_puppet':
    command => '/sbin/chkconfig puppet on',
    user    => 'root',
    minute  => '30',
    hour    => '*',
  }
  cron{'checi_disk_space':
    command => '/afs/ihep.ac.cn/soft/common/sysgroup/check_disk_space.sh',
    user    => 'shijy',
    minute  => '02',
    hour    => '1',
  }
#####Query user disk quota#####start by chengyaosong
  cron{'query_eos01_userdiskquota':
    command => '/cvmfs/common.ihep.ac.cn/software/monitor_plugin/userdisk_quota/eos/eosgetquota.py',
    user    => 'root',
    minute  => '00',
    hour    => '8',
  }
  cron{'query_lhmteos01_userdiskquota':
    command => '/cvmfs/common.ihep.ac.cn/software/monitor_plugin/userdisk_quota/eos/daochenggetquota.py',
    user    => 'root',
    minute  => '00',
    hour    => '8',
  }
  cron{'query_junoeos01_userdiskquota':
    command => '/cvmfs/common.ihep.ac.cn/software/monitor_plugin/userdisk_quota/eos/eosjunogetquota.py',
    user    => 'root',
    minute  => '00',
    hour    => '8',
  }
  cron{'query_homelhaaso_userdiskquota':
    command => '/cvmfs/common.ihep.ac.cn/software/monitor_plugin/userdisk_quota/home/lhgetquota.py',
    user    => 'root',
    minute  => '00',
    hour    => '8',
  }
  cron{'query_besfs5_userdiskquota':
    command => '/cvmfs/common.ihep.ac.cn/software/monitor_plugin/userdisk_quota/lustre/besfs5getquota.py',
    user    => 'root',
    minute  => '00',
    hour    => '8',
  }
  cron{'query_hxmt_userdiskquota':
    command => '/cvmfs/common.ihep.ac.cn/software/monitor_plugin/userdisk_quota/lustre/hxmtfsgetquota.py',
    user    => 'root',
    minute  => '00',
    hour    => '8',
  }
  cron{'query_juno_userdiskquota':
    command => '/cvmfs/common.ihep.ac.cn/software/monitor_plugin/userdisk_quota/lustre/junofsgetquota.py',
    user    => 'root',
    minute  => '00',
    hour    => '8',
  }
  cron{'query_scratch_userdiskquota':
    command => '/cvmfs/common.ihep.ac.cn/software/monitor_plugin/userdisk_quota/lustre/scratchfsgetquota.py',
    user    => 'root',
    minute  => '00',
    hour    => '8',
  }
  cron{'query_workfs2_userdiskquota':
    command => '/cvmfs/common.ihep.ac.cn/software/monitor_plugin/userdisk_quota/lustre/workfs2getquota.py',
    user    => 'root',
    minute  => '00',
    hour    => '8',
  }
  cron{'query_heps_userdiskquota':
    command => '/cvmfs/common.ihep.ac.cn/software/monitor_plugin/userdisk_quota/lustre/hepsfsgetquota.py',
    user    => 'root',
    minute  => '00',
    hour    => '8',
  }
  cron{'query_ihepfs_userdiskquota':
    command => '/cvmfs/common.ihep.ac.cn/software/monitor_plugin/userdisk_quota/lustre/ihepfsgetquota.py',
    user    => 'root',
    minute  => '00',
    hour    => '8',
  }
  cron{'query_publicfs_userdiskquota':
    command => '/cvmfs/common.ihep.ac.cn/software/monitor_plugin/userdisk_quota/lustre/publicfsgetquota.py',
    user    => 'root',
    minute  => '00',
    hour    => '8',
  }
  cron{'query_sharefs_userdiskquota':
    command => '/cvmfs/common.ihep.ac.cn/software/monitor_plugin/userdisk_quota/lustre/sharefsgetquota.py',
    user    => 'root',
    minute  => '00',
    hour    => '8',
  } 
  cron{'query_epfs_userdiskquota':
    command => '/cvmfs/common.ihep.ac.cn/software/monitor_plugin/userdisk_quota/lustre/epfsgetquota.py',
    user    => 'root',
    minute  => '00',
    hour    => '8',
  }   
    cron{'query_extpfs_userdiskquota':
    command => '/cvmfs/common.ihep.ac.cn/software/monitor_plugin/userdisk_quota/lustre/extpfsgetquota.py',
    user    => 'root',
    minute  => '00',
    hour    => '8',
  } 
    cron{'query_herdfs_userdiskquota':
    command => '/cvmfs/common.ihep.ac.cn/software/monitor_plugin/userdisk_quota/lustre/herdfsgetquota.py',
    user    => 'root',
    minute  => '00',
    hour    => '8',
  } 
    cron{'query_hpcfs_userdiskquota':
    command => '/cvmfs/common.ihep.ac.cn/software/monitor_plugin/userdisk_quota/lustre/hpcfsgetquota.py',
    user    => 'root',
    minute  => '00',
    hour    => '8',
  } 
    cron{'query_sdcfs_userdiskquota':
    command => '/cvmfs/common.ihep.ac.cn/software/monitor_plugin/userdisk_quota/lustre/sdcfsgetquota.py',
    user    => 'root',
    minute  => '00',
    hour    => '8',
  } 
  cron{'query_afs_userdiskquota':
    command => '/cvmfs/common.ihep.ac.cn/software/monitor_plugin/userdisk_quota/afs/afsgetquota.sh',
    user    => 'root',
    minute  => '00',
    hour    => '8',
  } 
  #####end#####end by chengyaosong
  file{"/etc/sysconfig/iptables":
    mode       =>  '600',
    owner      =>  'root',
    group      =>  'root',
    source     =>  "puppet:///modules/${module_name}/iptables-for-ccopt",
    require    =>  File['/root/bin'],
    notify     =>  Service["iptables"],
  }
  service {"iptables":
    ensure      => running,
    hasstatus   => true,
    hasrestart  => true,
    enable      => true,
  }
}
